/**
 * 
 */
package org.bankabeule.ui.actions;

import org.bankabeule.ui.Activator;
import org.bankabeule.ui.utils.Logger;
import org.bankabeule.ui.utils.UIUtils;
import org.bankabeule.ui.wizards.AccountWizard;
import org.eclipse.jface.wizard.WizardDialog;
import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Shell;

/**
 * @author sdudoit
 *
 */
public class AddAccountAction extends AbstractAction {

	
	public AddAccountAction() {
		super();
		setText("&Add account ...");
		setId(getClass().getCanonicalName());
		setImageDescriptor(Activator.getImageDescriptor("Add.gif"));
	}
	
	
	@Override
	public void run() {
		try {
			WizardDialog dialog = new WizardDialog(Display.getCurrent().getActiveShell(),
					new AccountWizard(null)) {

				@Override
				protected void configureShell(Shell newShell) {
					super.configureShell(newShell);
					UIUtils.center(newShell, getParentShell(), 400, 500);
				}
				
			};
			dialog.open();
		} catch (Exception e) {
			Logger.log(e);
		}
	}
	
}
